<?php
class Application_Model_DbTable_Syllabus extends Zend_Db_Table_Abstract{
	protected $_name = 'syllabus';
	
	public function fetchByGroup($annee, $section){
		$select = $this->select();
		$select->setIntegrityCheck(false);
		
		$select ->from(array('n'=>$this->_name))
				->joinLeft(array('a'=>'auteur'), 'n.syllabus_id = a.syllabus_id')
				->joinLeft(array('p'=>'professeur'), 'a.professeur_id = p.professeur_id')
				->joinLeft(array('s'=>'section'), 'n.section_id = s.section_id')
				->where('n.annee = ?',$annee)
				->where('n.section_id = ?',$section)
				->order(array('n.section_id','n.annee','n.intitule'));
		return $select->query()->fetchAll(PDO::FETCH_OBJ);		
	}
}